package com.shop.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.shop.dao.EmpMapper;
import com.shop.entity.Emp;
import com.shop.service.EmpService;
@Service
public class EmpServiceImpl implements EmpService {
	@Autowired
	private EmpMapper empMapper;
	@Override
	@Transactional(propagation=Propagation.SUPPORTS,isolation=Isolation.READ_COMMITTED)
	public List<Emp> findAll() {
		return empMapper.findAll();
	}
	public EmpMapper getEmpMapper() {
		return empMapper;
	}
	public void setEmpMapper(EmpMapper empMapper) {
		this.empMapper = empMapper;
	}
	@Override
	@Transactional(propagation=Propagation.SUPPORTS)
	public Emp findById(Integer id) {
		return empMapper.findById(id);
	}
	@Override
	@Transactional(propagation=Propagation.REQUIRED)
	public Integer updateEmp(Emp emp) {
		return empMapper.updateEmp(emp);
	}
	@Override
	public Integer deleteEmps(List<Integer> list) {
		return empMapper.deleteEmps(list);
	}
	

}
